1. Field of the Invention
The present invention relates to a system, method, and program for updating records in a database when applications have different version levels.
2. Description of the Related Art
In a database system, an application program may attempt to access and manipulate rows of data in a database table. If the database table is upgraded to include additional columns of data, then an upgraded version of the application may write meaningful data to the additional columns. If the application is down level to a current version level such that the down level version recognizes less than all of the columns in the data base table, then certain of the down level application operations could corrupt or erase meaningful data in the additional columns not recognized by the downgraded application. The term “down level” refers to a version of an application that was released before an “upgraded” version. Such down level applications typically include less functionality than the upgraded version.
For instance, a down level application may erase or corrupt meaningful data when updating a key column in an index record in an index on a database table, where the index provides a sorting of the table records according to the value(s) in the key column(s). The index key columns are comprised of selected columns of the table, and may include any of the values that are possible for that particular column. Columns that are used frequently to access a table may be used as key columns. The index may order the records according to their index column values in a B-tree data structure, or balanced tree. Moreover, the down level application may erase or corrupt meaningful data when updating a non-key column in the database.
When updating one index key column for the database table, the down level application must delete the affected row from the table so that the down level application may enter the modified data into the column at-issue. Upon updating the index key column, the down level application would provide the record to an index manager within the database engine to reinsert the updated record in the index according to the index ordering method, e.g., a B-tree index. In the prior art, the down level application would delete and update a record by first fetching the record, deleting the record, updating the columns and then reinserting the record. However, if the down level application does not provide data for all the columns, then the database engine would use default values for extended columns not recognized by the down level application in the inserted record, thereby erasing any meaningful data that was previously maintained in the extended columns by the upgraded version but unknown to the down level application.
For these reasons, there is a need in the art for improved techniques for allowing applications to update rows in a database table.